package cn.pfund.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.web.multipart.MultipartFile;

 /**
 *商品
 * @author zhaominglei qq:351024274，专注于网站、app和游戏开发。
 * @date 2017年1月20日
 */
@Entity
@Table(name="pfund_product")
public class Product extends BaseEntity implements Serializable {
	private static final long serialVersionUID = -8500071521197679706L;
	/** 名称 **/
	private String name;
	/** 图片 **/
	private String source;
	/** 介绍 **/
	private String introduction;
	/** 日涨幅 **/
	private String rzf;
	/** 月收益 **/
	private String ysy;
	/** 发行以来收益 **/
	private String fxylsy;
	/** 基金经理 **/
	private String jjjl;
	/** 发行公司 **/
	private String fxgs;
	/** 发行日期 **/
	private String fxrq;
	/** 最近一次调仓日期 **/
	private String zjyctc;
	/** 建仓 **/
	private String jc;
	/** 基金概况介绍 **/
	private String jjgk;
	/** 基金经理介绍 **/
	private String jjjljs;
	/** 发行公司介绍 **/
	private String fxgsjs;
	/** 是否上架 **/
	private Boolean isMarketable;
	/** 商品类别 **/
	private ProductType productType;
    /** 标签 */
    private Set<Tag> tags = new HashSet<Tag>();
	/** 文件 */
	private MultipartFile file;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public String getIntroduction() {
		return introduction;
	}
	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
	public String getRzf() {
		return rzf;
	}
	public void setRzf(String rzf) {
		this.rzf = rzf;
	}
	public String getYsy() {
		return ysy;
	}
	public void setYsy(String ysy) {
		this.ysy = ysy;
	}
	public String getFxylsy() {
		return fxylsy;
	}
	public void setFxylsy(String fxylsy) {
		this.fxylsy = fxylsy;
	}
	public String getJjjl() {
		return jjjl;
	}
	public void setJjjl(String jjjl) {
		this.jjjl = jjjl;
	}
	public String getFxgs() {
		return fxgs;
	}
	public void setFxgs(String fxgs) {
		this.fxgs = fxgs;
	}
	public String getFxrq() {
		return fxrq;
	}
	public void setFxrq(String fxrq) {
		this.fxrq = fxrq;
	}
	public String getZjyctc() {
		return zjyctc;
	}
	public void setZjyctc(String zjyctc) {
		this.zjyctc = zjyctc;
	}
	public String getJc() {
		return jc;
	}
	public void setJc(String jc) {
		this.jc = jc;
	}
	@Column(columnDefinition="LONGTEXT")
	public String getJjgk() {
		return jjgk;
	}
	public void setJjgk(String jjgk) {
		this.jjgk = jjgk;
	}
	@Column(columnDefinition="LONGTEXT")
	public String getJjjljs() {
		return jjjljs;
	}
	public void setJjjljs(String jjjljs) {
		this.jjjljs = jjjljs;
	}
	@Column(columnDefinition="LONGTEXT")
	public String getFxgsjs() {
		return fxgsjs;
	}
	public void setFxgsjs(String fxgsjs) {
		this.fxgsjs = fxgsjs;
	}
	@Column(name="is_marketable", columnDefinition="BIT")
	public Boolean getIsMarketable() {
		return isMarketable;
	}
	public void setIsMarketable(Boolean isMarketable) {
		this.isMarketable = isMarketable;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="productType_id")
	public ProductType getProductType() {
		return productType;
	}
	public void setProductType(ProductType productType) {
		this.productType = productType;
	}
	@ManyToMany(fetch=FetchType.LAZY)
	@JoinTable(name="pfund_product_tag", joinColumns = { @JoinColumn(name = "product_id", updatable = false) },	inverseJoinColumns = { @JoinColumn(name = "tag_id", updatable = false) })
	public Set<Tag> getTags() {
		return tags;
	}
	public void setTags(Set<Tag> tags) {
		this.tags = tags;
	}
	@Transient
	public MultipartFile getFile() {
		return file;
	}
	public void setFile(MultipartFile file) {
		this.file = file;
	}
}
